#include "Camera.h"

///////////////////////////////////////////////////////////////////////////
/// constructors
///////////////////////////////////////////////////////////////////////////

Camera::Camera() {

	Set();

}

Camera::Camera(float _eyex, float _eyey, float _eyez, float _centerx, float _centery, float _centerz, float _upx, float _upy, float _upz) {
	Set(_eyex, _eyey, _eyez, _centerx, _centery, _centerz, _upx, _upy, _upz);
}

Camera::Camera(float _eyex, float _eyey, float _eyez, float _centerx, float _centery, float _centerz, float _upx, float _upy, float _upz, float _nearplane, float _farplane) {
	Set(_eyex, _eyey, _eyez, _centerx, _centery, _centerz, _upx, _upy, _upz);
}

///////////////////////////////////////////////////////////////////////////
/// public functions
///////////////////////////////////////////////////////////////////////////

void Camera::Set() {
	
	eyex = 0.f;
	eyey = 0.f;
	eyez = -1.f;

	centerx = 0.f;	
	centery = 0.f;
	centerz = 0.f;
	
	upx = 0.f;
	upy = 1.f;
	upz = 0.f;

	nearplane = 0.01f;
	farplane = 1000.f;
	invfarplane = 1.f / farplane;
}

void Camera::Set(float _eyex, float _eyey, float _eyez, float _centerx, float _centery, float _centerz, float _upx, float _upy, float _upz, float _nearplane, float _farplane) {
	eyex = _eyex;
	eyey = _eyey;
	eyez = _eyez;

	centerx = _centerx;	
	centery = _centery;
	centerz = _centerz;
	
	upx = _upx;
	upy = _upy;
	upz = _upz;

	nearplane = _nearplane;
	farplane = _farplane;
	invfarplane = 1.f / farplane;
}